﻿using Libs;
using System.IO;

namespace WriteForFighting.Game.Asset
{
    static class Font
    {
        public static int NormalInfoAA { get; private set; }
        public static int Header1AA { get; private set; }
        public static int Header2AA { get; private set; }
        public static int Header3AA { get; private set; }
        public static int Header4AA { get; private set; }
        public static int Header5AA { get; private set; }
        public static int Header6AA { get; private set; }
        public static int GosickNormalAA { get; private set; }

        private const string CreateWrongMessage = "フォントの読み込み・初期化に失敗しました:";

        public static void Init()
        {
            {
                const string fn = "メイリオ";
                NormalInfoAA = DX.CreateFontToHandle(fn, 12, 1, DX.DX_FONTTYPE_ANTIALIASING, 0, 1);
                if (NormalInfoAA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header1AA = DX.CreateFontToHandle(fn, 36, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header1AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header2AA = DX.CreateFontToHandle(fn, 30, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header2AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header3AA = DX.CreateFontToHandle(fn, 24, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header3AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header4AA = DX.CreateFontToHandle(fn, 18, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header4AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header5AA = DX.CreateFontToHandle(fn, 14, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header5AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "メイリオ";
                Header6AA = DX.CreateFontToHandle(fn, 12, -1, DX.DX_FONTTYPE_ANTIALIASING_EDGE, 0, 1);
                if (Header6AA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }

            {
                const string fn = "MSゴシック";
                GosickNormalAA = DX.CreateFontToHandle(fn, 12, 2, DX.DX_FONTTYPE_ANTIALIASING, 0, 1);
                if (NormalInfoAA == -1)
                {
                    throw new IOException(CreateWrongMessage + fn);
                }
            }
        }
    }
}
